package cn.edu.cxcyzx.service.impl;

import java.util.Arrays;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.edu.cxcyzx.entity.RoomPOJO;
import cn.edu.cxcyzx.service.RoomService;
import cn.edu.cxcyzx.supervisor.DaoFit;
import cn.edu.cxcyzx.supervisor.ResultDo;

@Service("RoomService")
public class RoomServiceImpl implements RoomService {
	
	@Resource
	public DaoFit daoFit;

	@Override
	public ResultDo<List<RoomPOJO>> getRooms() {
		// TODO Auto-generated method stub
		ResultDo<List<RoomPOJO>> resultDo=new ResultDo<>();
		List<RoomPOJO> list=daoFit.getRoomDao().getRooms();
		if(list!=null&&list.size()>0){
			System.out.println("size:"+list.size());
			System.out.println("数据："+Arrays.toString(list.toArray()));
			resultDo.setSuccess(true);
			resultDo.setResult(list);
		}else{
			resultDo.setSuccess(false);
		}
		return resultDo;
	}

}
